<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title><?php echo CHtml::encode($this->pageTitle); ?></title>

<link rel="stylesheet" media="screen" href="<?php echo bu('css/reset.css'); ?>" />
<link rel="stylesheet" media="screen" href="<?php echo bu('css/grid.css'); ?>" />
<link rel="stylesheet" media="screen" href="<?php echo bu('css/style.css'); ?>" />
<link rel="stylesheet" media="screen" href="<?php echo bu('css/messages.css'); ?>" />
<link rel="stylesheet" media="screen" href="<?php echo bu('css/forms.css'); ?>" />

<!--[if lt IE 9]>
<script src="js/html5.js"></script>
<script src="js/PIE.js"></script>
<![endif]-->
<!-- jquerytools -->
<script src="<?php echo bu('js/jquery.tools.min.js'); ?>"></script>
<script src="<?php echo bu('js/jquery.ui.min.js'); ?>"></script>

<!--[if lte IE 9]>
<link rel="stylesheet" media="screen" href="css/ie.css" />
<script type="text/javascript" src="js/ie.js"></script>
<![endif]-->

<script src="<?php Yii::app() -> request -> baseUrl; ?>/js/global.js"></script>


<script>
$(document).ready(function(){
    $.tools.validator.fn("#username", function(input, value) {
        return value!='Username' ? true : {
            en: "Please complete this mandatory field"
        };
    });

    $.tools.validator.fn("#password", function(input, value) {
        return value!='Password' ? true : {
            en: "Please complete this mandatory field"
        };
    });

    $("#form").validator({
    	position: 'top',
    	offset: [25, 10],
    	messageClass:'form-error',
    	message: '<div><em/></div>' // em element is the arrow
    }).attr('novalidate', 'novalidate');
});
</script>

<script>
  $(document).ready(function(){
    if($(".errorMessage").css('display') != 'none')
    {
      $("#error").css('display','block');
      $('#username').val('');
      $('#password').val('');
    }
    else
    {
      $("#error").css('display','none');
    }
  });
</script>

</head>
<body class="login">
    <div class="login-box main-content">
      <header><h2>ACSI Admin's Page</h2></header>
    	<section>

    <?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'form',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
)); ?>
      <div id="error" class="message error"><?php echo $form->error($model,'password'); ?></div>
			<p>
        <?php echo $form->textField($model, 'username', array('class' => 'full', 'id' => 'username', 'required' => 'required', 'placeholder' => 'Username')); ?>
			</p>
			<p>
        <?php echo $form->passwordField($model, 'password', array('class' => 'full', 'id' => 'password', 'required' => 'required', 'placeholder' => 'Password')); ?>
			</p>
			<p class="clearfix">
				<span class="fl">
					<input type="checkbox" id="remember" class="" value="1" name="remember"/>
					<label class="choice" for="remember">Remember me</label>
				</span>

        <?php echo CHtml::submitButton('Login', array('class' => 'button button-gray fr')) ?>
			</p>
    <?php $this->endWidget(); ?>
		<!--<ul><li><strong>HELP!</strong>&nbsp;<a href="#">I forgot my password!</a></li></ul>-->
    	</section>
    </div>
</body>
</html>